-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve testing framework #286
Conversation
@sim-immunant here's my start to cleaning up the testing framework. I don't think we're getting much out of More context is in #154 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good--criterion test entrypoints are way better than having to parse arguments to decide which test case to run.
I would absolutely like to get rid of |
rewriter/tests/mmap_loop/main.c
Outdated
int res = munmap(lib_buf_mmap, 4096); | ||
cr_log_info(res ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stylistically I prefer putting separate calls under and if
branch, especially since we already have one.
rewriter/tests/ro_sharing/main.c
Outdated
Test(ro_sharing, plugin, .exit_code = 255) { | ||
cr_log_info("%s", get_plugin_str()); | ||
cr_log_info("0x%x", *get_plugin_uint(false)); | ||
cr_log_info("0x%x", *get_plugin_uint(true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we put the CHECK_VIOLATION
around the get_plugin_uint deref?
rewriter/tests/ro_sharing/plugin.c
Outdated
|
||
// Check that we can't read a pointer to data passed from main | ||
// TODO can we change this LOG to cr_log_info? | ||
CHECK_VIOLATION(LOG("0x%x", *secret)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, change this to a cr_log and put the CHECK_VIOLATION
around the *secret
if we can?
// LINKARGS: --wrap=call_operation | ||
uint32_t call_operation(size_t i) { | ||
// TODO: Add a way to share strings between compartments | ||
//printf("%s\n", operations[i].desc.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think we can remove the comment on the printf and the TODO We previously treated the .rodata
sections (where string literals are placed) as secret, but we have since moved on to only treating writable sections that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I can't hit the approve button because I own the PR still. That's fine, just address the existing comments, resolve what's taken care of, and if it all looks good land it.
We don't have a --function-allowlist anymore, so this is testing nothing.
f27b74a
to
40f076b
Compare
No description provided.